/**
 * Copyright (C)  2011  chen wei hua.
 * Permission is granted to copy, distribute and/or modify this document
 * under the terms of the GNU Free Documentation License, Version 2.0
 * or any later version published by the Free Software Foundation;
 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 * A copy of the license is included in the section entitled "GNU Free Documentation License".
 */
package com.javaeye.delivery.dto;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.javaeye.common.dto.DTO;
import com.javaeye.common.util.ListUtil;

public class DeliveryOrder implements DTO {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6894920169941893269L;

	private String id;
	
	private String purchaseOrderId;
	
	private String orderNo;
	
	private Date deliveryDate;
	
	private String customName;
	
	private int customId;
	
	private String batchNumber;
	
	private String receivers;
	
	private String telephone;
	
	private String address;
	
	private double totleAmount;
	
	private String logisticsType;
	
	private String logisticsName;
	
	private int logisticsId;
	
	private double totleWeight;
	
	private double totleVolume;
	
	private long reasons;

	private Set<DeliveryOrderDetail> orderDetails = new HashSet<DeliveryOrderDetail>();
	
	public void addDetail(DeliveryOrderDetail detail) {
		detail.setOrder(this);
		orderDetails.add(detail);
	}
	
	public String getLogisticsTypeName() {
		return ListUtil.logisticsTypeName(logisticsType);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPurchaseOrderId() {
		return purchaseOrderId;
	}

	public void setPurchaseOrderId(String purchaseOrderId) {
		this.purchaseOrderId = purchaseOrderId;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public Date getDeliveryDate() {
		return deliveryDate;
	}

	public void setDeliveryDate(Date deliveryDate) {
		this.deliveryDate = deliveryDate;
	}

	public String getCustomName() {
		return customName;
	}

	public void setCustomName(String customName) {
		this.customName = customName;
	}

	public int getCustomId() {
		return customId;
	}

	public void setCustomId(int customId) {
		this.customId = customId;
	}

	public String getBatchNumber() {
		return batchNumber;
	}

	public void setBatchNumber(String batchNumber) {
		this.batchNumber = batchNumber;
	}

	public String getReceivers() {
		return receivers;
	}

	public void setReceivers(String receivers) {
		this.receivers = receivers;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public double getTotleAmount() {
		return totleAmount;
	}

	public void setTotleAmount(double totleAmount) {
		this.totleAmount = totleAmount;
	}

	public String getLogisticsType() {
		return logisticsType;
	}

	public void setLogisticsType(String logisticsType) {
		this.logisticsType = logisticsType;
	}

	public String getLogisticsName() {
		return logisticsName;
	}

	public void setLogisticsName(String logisticsName) {
		this.logisticsName = logisticsName;
	}

	public int getLogisticsId() {
		return logisticsId;
	}

	public void setLogisticsId(int logisticsId) {
		this.logisticsId = logisticsId;
	}

	public double getTotleWeight() {
		return totleWeight;
	}

	public void setTotleWeight(double totleWeight) {
		this.totleWeight = totleWeight;
	}

	public double getTotleVolume() {
		return totleVolume;
	}

	public void setTotleVolume(double totleVolume) {
		this.totleVolume = totleVolume;
	}

	public Set<DeliveryOrderDetail> getOrderDetails() {
		return orderDetails;
	}

	public void setOrderDetails(Set<DeliveryOrderDetail> orderDetails) {
		this.orderDetails = orderDetails;
	}

	/**
	 * @param reasons the reasons to set
	 */
	public void setReasons(long reasons) {
		this.reasons = reasons;
	}

	/**
	 * @return the reasons
	 */
	public long getReasons() {
		return reasons;
	}
	
}
